//
//  BEAddressView.swift
//  BEGlobalOiler
//
//  Created by KKING on 16/8/19.
//  Copyright © 2016年 Bullseye Energy pte ltd. All rights reserved.
//

import UIKit
import CoreLocation
import GoogleMaps

class BEAddressView: UIView{
    
    @IBOutlet weak var addressTF: UITextField!
    @IBOutlet weak var cityTF: UITextField!
    @IBOutlet weak var stateTF: UITextField!
    
    /*
     self.addressView.getAddressWithCoordinateBlock = { (addressTF: UITextField,cityTF: UITextField,stateTF: UITextField) -> () in
     }
     */
    var dismissMapBlock: (() -> ())?
    
    var getAddressWithCoordinateBlock: ((_ addressTF: UITextField,_ cityTF: UITextField,_ stateTF: UITextField) -> ())?
    
    func currentLocation() {
        getAddressWithCoordinateBlock!(self.addressTF,self.cityTF,self.stateTF)
    }
    
    
    class func addressView()->UIView {
        return Bundle.main.loadNibNamed("BEAddressView", owner: nil, options: nil)!.last as! UIView
    }
    
    
    @IBAction func submitButtonDidClick(sender: AnyObject) {
        dismissMapBlock!()
    }
    
}

